package com.zerosky.crm.service;

import java.util.List;
import java.util.Map;

import com.zerosky.crm.po.Customer;
import com.zerosky.crm.util.PageInfo;

/**
 * Customer业务逻辑接口
 * 
 * @author hugy;
 * @since 2017-06-08
 */
public interface CustomerService {

	/**
	 * Customer列表接口
	 * 
	 * @author hugy;
	 * @since 2017-06-08
	 */
	public List<Customer> getCustomerList(Map map);

	/**
	 * Contract列表接口
	 * 
	 * @author hugy;
	 * @since 2017-06-08
	 */
	public PageInfo<Customer> getCustomerPageInfoList(Map map, PageInfo<Customer> page);

	/**
	 * 通过主键查找Customer实体接口
	 * 
	 * @param id
	 *            Customer主键
	 * @author hugy;
	 * @since 2017-06-08
	 */
	public Customer getCustomerById(String id);
	
	/**
	 * 通过主键查找Customer实体接口
	 * 
	 * @param id
	 *            Customer主键
	 * @author hugy;
	 * @since 2017-06-08
	 */
	public Customer customerLogin(Map map);
	
	/**
	 * 保存Customer接口
	 * 
	 * @param Customer
	 *            实体对象, operation 操作类型
	 * @author hugy;
	 * @since 2017-06-08
	 */
	public int saveCustomer(Customer customer, String operation) throws Exception;

	/**
	 * 批量保存Customer接口
	 * 
	 * @param Customer
	 *            实体对象, operation 操作类型
	 * @author hugy;
	 * @since 2017-06-08
	 */
	public void addCustomerList(List<Customer> customer) throws Exception;

	/**
	 * 删除Customer接口
	 * 
	 * @param idArray
	 *            Customer主键数组
	 * @author hugy;
	 * @since 2017-06-08
	 */
	public void deleteCustomerById(String id) throws Exception;

	/**
	 * 获取到其他部门客户人数
	 * 
	 * @param deptId
	 * @return
	 */
	public PageInfo<Customer> getOtherDeptCustomerNumber(Map map, PageInfo<Customer> page);

	/**
	 * 获取到其他部门客户总人数
	 * 
	 * @param deptId
	 * @return
	 */
	public Integer getOtherDeptCustomerNumberSum(Map map);

	/**
	 * 获取近期过生日的客户数量
	 * 
	 * @param map
	 * @return
	 */
	public int getBirthdayCount(Map map);

	/**
	 * 验证是否存在相同的手机号码和身份证号码
	 * 
	 * @param map
	 * @return
	 */
	public Customer validateCustomer(Map map);
	/**
	 * 查询客户数量
	 * 
	 */
	public int countCustomer(Map map);
}
